{% extends "base.volt" %}

{% block pageFooter%}
    {{ javascript_include("/assets/manage/js/sys/opList.js", false) }}
{% endblock %}

{% block content %}
    {{ partial("module/left_sys") }}
    <div class="col-xs-10">
        <ol class="breadcrumb">
            <li>系统管理</li>
            <li><a href="{{ url.get('sys/opLog') }}">操作员管理</a></li>
            <li class="active">操作员列表</li>
        </ol>

        <table class="table table-hover">
            <thead>
            <tr>
                <th style="width: 60px;">ID</th>
                <th style="width: 120px;">操作员</th>
                <th style="width: 200px;">分组</th>
                <th>备注</th>
                <th style="width: 80px;">状态</th>
                <th style="width: 160px;">添加时间</th>
                <th style="width: 200px;"></th>
            </tr>
            </thead>
            {% for d in data %}
                <tr>
                    <td>{{ d.operator_id }}</td>
                    <td>{{ d.operator_show_name|e }}</td>
                    <td>{{ d.group_name|e }}</td>
                    <td>{{ d.operator_remark|e }}</td>
                    <td>{{ GeneralStateValue2Str(d.operator_state) }}</td>
                    <td>{{ d.operator_addtime }}</td>
                    <td>
                        <div class="dropdown">
                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu{{ d.operator_id }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><i class="fa fa-cogs"></i> 操作 <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu{{ d.operator_id }}">
                                <li><a class="but_update_base" durl="{{ url.get('sys/opUpdateBase', ['id': d.operator_id]) }}" dtitle="更新操作员【{{ d.operator_show_name|escape_attr }}】的基础信息" href="javascript:void(0)"><i class="fa fa-pencil fa-fw"></i> 更新基础信息</a></li>
                                <li><a class="but_update_pwd" did="{{ d.operator_id }}" durl="{{ url.get('sys/opUpdatePwd') }}" dtitle="修改操作员【{{ d.operator_show_name|escape_attr }}】的密码" href="javascript:void(0)"><i class="fa fa-key fa-fw"></i> 修改密码</a></li>
                                <li role="separator" class="divider"></li>
                                {% if d.operator_state == 1 %}
                                    <li><a href="javascript:void(0)" durl="{{ url.get('sys/opSetState') }}" did="{{ d.operator_id }}" dstate="-1" class="but_set_state"><i class="fa fa-trash-o fa-fw"></i> 删 除</a></li>
                                {% endif %}
                                {% if d.operator_state == -1 %}
                                    <li><a href="javascript:void(0)" durl="{{ url.get('sys/opSetState') }}" did="{{ d.operator_id }}" dstate="1" class="but_set_state"><i class="fa fa-reply fa-fw"></i> 恢 复</a></li>
                                {% endif %}
                            </ul>
                        </div>
                    </td>
                </tr>
            {% endfor %}
        </table>

    </div>
{% endblock %}